home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / system / danix201.zip / CUT.1 < prev    next >
Text File  |  1994-01-15  |  2KB  |  46 lines

  1. CUT(1)                Danix Utilities                CUT(1)
  2.  
  3. NAME
  4.     cut - cut selected fields or columns from given files
  5.  
  6. SYNOPSIS
  7.     cut -c<list> files ...
  8.     cut -f<list> [ -d<char> ] [ -s ] files ...
  9.  
  10. DESCRIPTION
  11.     cut prints out selected characters or fields from each line of
  12.     the given files.  If the file list is empty or a '-' is
  13.     encountered in the file list, input is taken from standard input.
  14.  
  15.     <list> specifies which characters or fields to print.  It consists
  16.            of any number of comma-separated integers of the selected
  17.            fields or columns.  1,2,3,5 will print out the first,
  18.            second, third, and fifth fields or characters of each line.
  19.            Lists can be shortened by using ranges of numbers, such as
  20.            1-3,5 which gives the same result as before.  If the
  21.            beginning integer of a range is omitted (i.e. -5,7) it is
  22.            assumed to be 1.  A missing ending integer will cause the
  23.            rest of the line to be printed.
  24.  
  25.     -c specifies character positions to be printed out.  (cut -c3,5
  26.        will print out the third and fifth character of each line.)
  27.  
  28.     -f specifes fields to be printed out.  Fields are assumed to be
  29.        separated by a tab character.
  30.  
  31.     -d specify a field delimiter for the -f option.  A space or
  32.        other characters which the shell may interpret incorrectly
  33.        should be quoted.  (cut -d" " -f<list> ...)
  34.  
  35.     -s Suppresses the printing of lines without the delimiter
  36.        character, in the case of the -f option.
  37.  
  38. EXAMPLES
  39.     cut -f2 -d, files ...
  40.         display the second field of each line of each of the given
  41.         files.  Fields in this case are separated by commas.
  42.     <command> | cut -c-5 file -
  43.         display the first five characters of each line of the given
  44.         file as well as the first five characters of each line of the
  45.         standard input
  46.